import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Index',
    redirect: {name: "dashboard"}
  },
  {
    path: '/dashboard',
    name: 'dashboard',
    component:() => import('../views/dashboard'),
    redirect: '/dashboard/index',
    meta: { title: '首页显示', icon: 'example' },
    children: [
      {
        path: 'index',
        name: '首页显示',
        component: () => import('../views/video/index'),
        meta: { title: '分类显示',  noCache: 'true' },
        hidden:true
      },
      {
        path: 'list',
        name: '视频列表',
        component: () => import('../views/video/list'),
        meta: { title: '视频列表',  noCache: 'true' },
        hidden:true
      }
      ]
  },
  {
    path: '/order/:id',
    name: '订单',
    component:() => import('../views/video/order'),
  },
  {
    path: '/pay/:id',
    name: '支付',
    component:() => import('../views/video/pay'),
  },
  {
    path: '/play/:id',
    name: '视频播放',
    component:() => import('../views/video/play'),
  },
  {
    path: '/login',
    name: '登录',
    component:() => import('../views/login')
  },
  {
    path: '/register',
    name: '注册',
    component:() => import('../views/register')
  },
  {
    path: '/user/:id',
    name: '修改用户',
    component:() => import('../views/updateUser')
  },
]

const router = new VueRouter({
  mode: 'history',
  routes
})

export default router
